package com.example.wendao.model.entity;

import androidx.databinding.BaseObservable;
import androidx.databinding.Bindable;
import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.Ignore;
import androidx.room.PrimaryKey;

@Entity
public class NewsPics extends BaseObservable {

    @PrimaryKey(autoGenerate = true)    //新闻图片id(主键自增)
    private int newsPicId;

    //所属新闻id(唯一)
    private int newsPicFatherId;

    //图片位置(int 0为封面，123为文中顺序)
    private int newsPicPlace;

    @ColumnInfo(typeAffinity = ColumnInfo.BLOB)//图片（blob）
    private byte[] newsPic;


    public int getNewsPicId() {
        return newsPicId;
    }

    public void setNewsPicId(int newsPicId) {
        this.newsPicId = newsPicId;
    }

    public int getNewsPicFatherId() {
        return newsPicFatherId;
    }

    public void setNewsPicFatherId(int newsPicFatherId) {
        this.newsPicFatherId = newsPicFatherId;
    }

    public int getNewsPicPlace() {
        return newsPicPlace;
    }

    public void setNewsPicPlace(int newsPicPlace) {
        this.newsPicPlace = newsPicPlace;
    }

    public byte[] getNewsPic() {
        return newsPic;
    }

    public void setNewsPic( byte[] newsPic) {
        this.newsPic = newsPic;
    }

    @Ignore
    public NewsPics(int newsPicId, int newsPicFatherId, int newsPicPlace, byte[] newsPic) {
        this.newsPicId = newsPicId;
        this.newsPicFatherId = newsPicFatherId;
        this.newsPicPlace = newsPicPlace;
        this.newsPic = newsPic;
    }

    public NewsPics(){}
}
